﻿using System;
using System.Collections;

namespace AspNetInfo.Helpers
{
    public class EnumHelper
    {
        public static Hashtable BindEnum(Type enumeration)
        {
            var names = Enum.GetNames(enumeration);
            var values = Enum.GetValues(enumeration);
            var ht = new Hashtable();
            for (var i = 0; i < names.Length; i++)
            {
                ht.Add(Convert.ToInt32(values.GetValue(i)).ToString(), names[i]);
            }
            return ht;
        }
    }
}
